from marketdata import statistic
from mapper import Mapper
import logging


class WipeOuter(Mapper):
    CHILD = None

    def map(self,key):
        ToDelete = [key]
        q = self.CHILD.all(keys_only = True)
        q.ancestor(key)
        ToDelete.extend(q)
        logging.info("ToDelete %d with key %s" % (len(ToDelete),str(key.name())))
        return ([],ToDelete)

class WipeOutOner(Mapper):

    def map(self,key):
        return ([],[key])
